<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('blind_shops', function (Blueprint $table) {
            $table->id();
            $table->foreignId('blind_id')->constrained('blinds', 'id', 'blind_id')->onDelete('cascade')->comment('盲盒id');
            $table->foreignId('shop_id')->constrained('shops', 'id', 'shop_id')->onDelete('cascade')->comment('商品id');
            $table->decimal('rate', 10, 2)->comment('中奖概率');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('blind_shops');
    }
};
